<?php

class IndexController extends Zend_Controller_Action
{
    protected $_db;

    public function init()
    {
        $this->_db = Zend_Registry::get('db_adaptor');
    }

    public function indexAction()
    {       
        $db = $this->_db;
        $db->query("set names utf8");

        $q = "SELECT * FROM company, com_cat, category "
           . "WHERE company.com_id = com_cat.com_id AND "
           . "com_cat.cat_id = category.cat_id LIMIT 20";

        $res = $this->view->companies = $db->fetchAssoc($q);

    }


}

